﻿<%@ WebHandler Language="C#" Class="ReportAssesmentPositionHandler" %>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

using Assesment.Library.DataAccess.Administration;
using Assesment.Library.DomainObject.Administration;
using Assesment.Library.DataAccess.Administration.Catalog;
using Assesment.Library.DataAccess.Transaction;
using Assesment.Library.DomainObject.Transaction;

using System.IO;
using OfficeOpenXml;

using Assesment.Library.Enum;
using Assesment.Web.Support;
using Newtonsoft.Json.Linq;
using System.Drawing;
using System.Data;

public class ReportAssesmentPositionHandler : Assesment.Web.BaseHandler
{
    AssesmentPositionRepo AssesmentPositionDal = new AssesmentPositionRepo(ConfigurationManager.ConnectionStrings["AssesmentConn"].ConnectionString);
    TotalFitRepo TotalFitDal = new TotalFitRepo(ConfigurationManager.ConnectionStrings["AssesmentConn"].ConnectionString);
    RecomendationRepo RecomendationDal = new RecomendationRepo(ConfigurationManager.ConnectionStrings["AssesmentConn"].ConnectionString);
    
    public override void ProcessRequest(HttpContext context)
    {
        JSONHelper helper = new JSONHelper();

        base.ProcessRequest(context);

        //System.IO.StreamReader sr = new System.IO.StreamReader(context.Request.InputStream);

        //string jsonString = string.Empty;
        //jsonString = context.Server.UrlDecode(sr.ReadToEnd());
        //JObject jObj = string.IsNullOrEmpty(jsonString) ? null : JObject.Parse(jsonString);

        //sr.Close();
        //sr.Dispose();

        context.Response.Clear();
        context.Response.Buffer = true;

                try
                {
                    int AssesmentPositionID=0;
                    if (context.Request.Params["AssesmentPositionID"] != null)
                        AssesmentPositionID =Convert.ToInt32(context.Request.Params["AssesmentPositionID"].ToString());
                    
                    string NamaKaryawan = string.Empty;
                    string NIK = string.Empty;
                    string Jabatan = string.Empty;
                    string Departemen = string.Empty;
                    string Lokasi = string.Empty;
                    string LokasiKerja = string.Empty;
                    string TglAssesment = string.Empty;
                    string JabatanTujuan = string.Empty;
                    string DepartemenTujuan = string.Empty;
                    string LokasiTujuan = string.Empty;
                    int TotalFitID = 0;
                    string Rating = string.Empty;
                    string PersonalDescription = string.Empty;
                    string Msdt = string.Empty;
                    string InterpretationPlus = string.Empty;
                    string InterpretationMin = string.Empty;

                    string TypePersonality = string.Empty;
                    string DiscPersonality = string.Empty;
                    string PreferredPlus = string.Empty;
                    string PreferredMinus = string.Empty;
                    string Definition = string.Empty;
                    string GradeDescPosition = string.Empty;
                    string GradeDescPositionAssesment = string.Empty;
                    
                    DataTable dtAssesment = AssesmentPositionDal.GetDataTableReport(AssesmentPositionID);
                    if (dtAssesment.Rows.Count > 0)
                    {
                        NamaKaryawan = dtAssesment.Rows[0]["NamaKaryawan"].ToString();
                        NIK = dtAssesment.Rows[0]["NIK"].ToString();
                        Jabatan = dtAssesment.Rows[0]["PositionName"].ToString();
                        Departemen = dtAssesment.Rows[0]["DepartmentDesc"].ToString();
                        Lokasi = dtAssesment.Rows[0]["Location"].ToString();
                        TglAssesment = dtAssesment.Rows[0]["AssesmentDate"].ToString();

                        JabatanTujuan = dtAssesment.Rows[0]["PositionAssesment"].ToString();
                        DepartemenTujuan = dtAssesment.Rows[0]["DepartmentAssesment"].ToString();
                        LokasiTujuan = dtAssesment.Rows[0]["LocationAssesment"].ToString();

                        TotalFitID = Convert.ToInt32(dtAssesment.Rows[0]["TotalFitID"].ToString());
                        PersonalDescription = dtAssesment.Rows[0]["PersonalDescription"].ToString();

                        Msdt = dtAssesment.Rows[0]["Msdt"].ToString();
                        InterpretationPlus = dtAssesment.Rows[0]["InterpretationPlus"].ToString();
                        InterpretationMin = dtAssesment.Rows[0]["InterpretationMin"].ToString();

                        TypePersonality = dtAssesment.Rows[0]["Type"].ToString();
                        DiscPersonality = dtAssesment.Rows[0]["Disc"].ToString();
                        PreferredPlus = dtAssesment.Rows[0]["PreferredPlus"].ToString();
                        PreferredMinus = dtAssesment.Rows[0]["PreferredMinus"].ToString();
                        Definition = dtAssesment.Rows[0]["Definition"].ToString();

                        GradeDescPosition = dtAssesment.Rows[0]["GradeDescPosition"].ToString();
                        GradeDescPositionAssesment = dtAssesment.Rows[0]["GradeDescPositionAssesment"].ToString();
                    }


                    DataTable dtAssesmentDetail = new DataTable();
                    
                    FileInfo newFile = new FileInfo(context.Server.MapPath("~/UploadReport" + @"/"+NIK+"_"+NamaKaryawan+".xlsx"));
                    // If any file exists in this directory having name 'Sample1.xlsx', then delete it
                    if (newFile.Exists)
                    {
                        newFile.Delete(); // ensures we create a new workbook
                        newFile = new FileInfo(context.Server.MapPath("~/UploadReport" + @"/" + NIK + "_" + NamaKaryawan + ".xlsx"));
                    }
                    using (ExcelPackage package = new ExcelPackage(newFile))
                    {
                        // Add a worksheet to the empty workbook
                        ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Assesment");

                        worksheet.View.ShowGridLines = false;

                        worksheet.Cells["B1:N1"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B1:N1"].Style.Fill.BackgroundColor.SetColor(Color.Black);

                        worksheet.Cells["B2:N2"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B2:N2"].Style.Fill.BackgroundColor.SetColor(Color.Black);

                        //worksheet.Cells["B9:N9"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        //worksheet.Cells["B9:N9"].Style.Fill.BackgroundColor.SetColor(Color.Black);

                       
                        worksheet.Column(1).Width = 2;
                        worksheet.Column(2).Width = 4;
                        worksheet.Column(3).Width = 10;
                        worksheet.Column(4).Width = 3;
                        worksheet.Column(5).Width = 18;
                        worksheet.Column(6).Width = 5;
                        worksheet.Column(7).Width = 20;
                        worksheet.Column(8).Width = 20;
                        worksheet.Column(9).Width = 3;
                        worksheet.Column(10).Width = 7;
                        worksheet.Column(11).Width = 7;
                        worksheet.Column(12).Width = 7;
                        worksheet.Column(13).Width = 7;
                        worksheet.Column(14).Width = 7;


                        worksheet.Cells["B1:N1"].Merge = true;
                        worksheet.Cells["B2:N2"].Merge = true;
                        worksheet.Cells["B1"].Value = "DATA PESERTA ASSESMENT";
                        worksheet.Cells["B1"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B1"].Style.Font.Size = 25;
                        worksheet.Cells["B1"].Style.Font.Color.SetColor(Color.White);
                        worksheet.Cells["B1"].Style.Font.Bold = true;
                        
                        
                        worksheet.Column(4).Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B3:C3"].Merge =true;
                        worksheet.Cells["B3"].Value = "NAMA";
                        worksheet.Cells["B3"].Style.Font.Size = 11;
                        worksheet.Cells["D3"].Value = ":";
                        worksheet.Cells["E3"].Value = NamaKaryawan;

                        worksheet.Cells["B4"].Value = "NIK";
                        worksheet.Cells["D4"].Value = ":";
                        worksheet.Cells["E4"].Value = NIK;

                        worksheet.Cells["B5"].Value = "JABATAN";
                        worksheet.Cells["D5"].Value = ":";
                        worksheet.Cells["E5"].Value = Jabatan;


                        worksheet.Cells["B6"].Value = "LEVEL JABATAN";
                        worksheet.Cells["D6"].Value = ":";
                        worksheet.Cells["D6"].Value = GradeDescPosition;

                        worksheet.Cells["B7"].Value = "DEPARTEMEN";
                        worksheet.Cells["D7"].Value = ":";
                        worksheet.Cells["E7"].Value = Departemen;

                        worksheet.Cells["B8"].Value = "LOKASI KERJA";
                        worksheet.Cells["D8"].Value = ":";
                        worksheet.Cells["E8"].Value = Lokasi;


                        
                        worksheet.Column(9).Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        
                        worksheet.Cells["H3"].Value = "TANGGAL ASSESMENT";
                        worksheet.Cells["I3"].Value = ":";
                        worksheet.Cells["J3"].Value = TglAssesment;

                        worksheet.Cells["H4"].Value = "JABATAN TUJUAN";
                        worksheet.Cells["I4"].Value = ":";
                        worksheet.Cells["J4"].Value = JabatanTujuan;

                        worksheet.Cells["H5"].Value = "LEVEL JABATAN";
                        worksheet.Cells["I5"].Value = ":";
                        worksheet.Cells["J5"].Value = GradeDescPositionAssesment;

                        worksheet.Cells["H6"].Value = "DEPARTEMEN";
                        worksheet.Cells["I6"].Value = ":";
                        worksheet.Cells["J6"].Value = DepartemenTujuan;
                        //worksheet.Cells["J6"].Style.WrapText = true;
                        worksheet.Cells["J6:N6"].Merge = true;
                            
                        worksheet.Cells["B10:N10"].Merge = true;
                        worksheet.Cells["B10"].Value = "KETERANGAN";
                        worksheet.Cells["B10"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B10"].Style.Font.Size = 18;
                        worksheet.Cells["B10"].Style.Font.Color.SetColor(Color.White);
                        worksheet.Cells["B10"].Style.Font.Bold = true;
                        worksheet.Cells["B10:N10"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B10:N10"].Style.Fill.BackgroundColor.SetColor(Color.Black);

                        worksheet.Cells["B11"].Value = "1.";
                        worksheet.Cells["C11:N11"].Merge = true;
                        worksheet.Cells["C11"].Value = "Proses assesment bertujuan untuk mengukur kompetensi individu, untuk kemudian di bandingkan dengan kompetensi yang di tetapkan pada jabatan tujuan.";
                        worksheet.Cells["C11"].Style.WrapText = true;
                        worksheet.Row(11).Height = 30;
                        worksheet.Cells["B11"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;

                        worksheet.Cells["B12"].Value = "2.";
                        worksheet.Cells["C12:N12"].Merge = true;
                        worksheet.Cells["C12"].Value = "Penilaian kompetensi menggunakan sistim rating dengan keterangan nilai sebagai berikut";
                        worksheet.Cells["C12"].Style.WrapText = true;

                        worksheet.Cells["C13:N13"].Merge = true;
                        worksheet.Cells["C13"].Value = "rating 1    : Kompetensi yang di harapkan tidak pernah muncul";
                        worksheet.Cells["C13"].Style.WrapText = true;
                        

                        worksheet.Cells["C14:N14"].Merge = true;
                        worksheet.Cells["C14"].Value = "rating 2    : Kompetensi yang di harapkan sangat jarang muncul";
                        worksheet.Cells["C14"].Style.WrapText = true;

                        worksheet.Cells["C15:N15"].Merge = true;
                        worksheet.Cells["C15"].Value = "rating 3    : kompetensi yang di harapkan sesekali muncul";
                        worksheet.Cells["C15"].Style.WrapText = true;

                        worksheet.Cells["C16:N16"].Merge = true;
                        worksheet.Cells["C16"].Value = "rating 4    : kompetensi yang di harapkan sering kali muncul";
                        worksheet.Cells["C16"].Style.WrapText = true;

                        worksheet.Cells["C17:N17"].Merge = true;
                        worksheet.Cells["C17"].Value = "rating 5    : kompetensi yang di harapkan muncul secara konsisten";
                        worksheet.Cells["C17"].Style.WrapText = true;

                        worksheet.Cells["B18"].Value = "3.";
                        worksheet.Cells["C18:N18"].Merge = true;
                        worksheet.Cells["C18"].Value = "Hasil akhir assesment aadalah persentasi fit kompetensi individu dibandingkan kompetensi jabatan, hasil maksimal fit adalah 100%";
                        worksheet.Cells["C18"].Style.WrapText = true;
                        worksheet.Row(18).Height = 30;
                        worksheet.Cells["B18"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                        
                            
                            
                        worksheet.Cells["B19:N19"].Merge = true;
                        worksheet.Cells["B20:N20"].Merge = true;

                        worksheet.Cells["B20"].Value = "HASIL ASSESMENT";
                        worksheet.Cells["B20"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B20"].Style.Font.Size = 25;
                        worksheet.Cells["B20"].Style.Font.Color.SetColor(Color.White);
                        worksheet.Cells["B20"].Style.Font.Bold = true;
                        worksheet.Cells["B20:N20"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B20:N20"].Style.Fill.BackgroundColor.SetColor(Color.Black);


                        worksheet.Row(21).Height = 30;
                        worksheet.Row(21).Style.Font.Size = 14;
                        worksheet.Row(21).Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["B21"].Value = "NO";
                        worksheet.Cells["B21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        
                        
                        worksheet.Cells["C21:I21"].Merge = true;
                        worksheet.Cells["C21"].Value = "KOMPETENSI";
                        worksheet.Cells["C21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B21:N21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B21:N21"].Style.Fill.BackgroundColor.SetColor(Color.Orange);//Color.LightYellow);

                        worksheet.Cells["B3"].Style.WrapText = true;
                        
                       
                        
                        worksheet.Cells["J21"].Value = "1";
                        worksheet.Cells["J21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["J21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["J21"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);

                        
                        worksheet.Cells["K21"].Value = "2";
                        worksheet.Cells["K21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["K21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["K21"].Style.Fill.BackgroundColor.SetColor(Color.Red);

                        
                        worksheet.Cells["L21"].Value = "3";
                        worksheet.Cells["L21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["L21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["L21"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                        
                        worksheet.Cells["M21"].Value = "4";
                        worksheet.Cells["M21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["M21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["M21"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                        
                        worksheet.Cells["N21"].Value = "5";
                        worksheet.Cells["N21"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N21"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["N21"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                        

                        worksheet.Cells["B22"].Value = "CORE COMPETENCY";
                        worksheet.Cells["B22"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B22:N22"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B22:N22"].Style.Fill.BackgroundColor.SetColor(Color.DarkGray);

                        worksheet.Cells["F22"].Value = "LEVEL";
                        worksheet.Cells["F22"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "CUSTOMER FOCUS");
                        
                        worksheet.Cells["B23"].Value = "1";
                        worksheet.Row(23).Height = 30;
                        worksheet.Cells["B23"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C23"].Value = "CUSTOMER FOKUS";
                        worksheet.Cells["C23"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                       
                        worksheet.Cells["F23"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G23:H23"].Merge = true;
                        worksheet.Cells["G23:H23"].Style.WrapText = true;

                        int jumlahRatingCore = 0;

                       
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F23"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J23"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J23"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J23:K23"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J23:K23"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J23:L23"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J23:L23"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J23:M23"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J23:M23"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J23:N23"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J23:N23"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G23"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingCore = Convert.ToInt32(Rating);
                        }



                        worksheet.Cells["B24"].Value = "2";
                        worksheet.Row(24).Height = 30;
                        worksheet.Cells["B24"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C24"].Value = "INTEGRITY";
                        worksheet.Cells["C24"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;

                        worksheet.Cells["F24"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G24:H24"].Merge = true;
                        worksheet.Cells["G24:H24"].Style.WrapText = true;


                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "INTEGRITY");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F24"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();// ":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J24"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J24"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J24:K24"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J24:K24"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J24:L24"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J24:L24"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J24:M24"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J24:M24"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J24:N24"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J24:N24"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G24"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingCore += Convert.ToInt32(Rating);
                        }


                        worksheet.Cells["B25"].Value = "3";
                        worksheet.Row(25).Height = 30;
                        worksheet.Cells["B25"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C25"].Value = "TEAM WORK";
                        worksheet.Cells["C25"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;

                        worksheet.Cells["F25"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G25:H25"].Merge = true;
                        worksheet.Cells["G25:H25"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "TEAM WORK");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F25"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J25"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J25"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J25:K25"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J25:K25"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J25:L25"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J25:L25"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J25:M25"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J25:M25"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J25:N25"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J25:N25"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G25"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingCore += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B26"].Value = "4";
                        worksheet.Row(26).Height = 30;
                        worksheet.Cells["B26"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C26"].Value = "WORK EXCELLENCE";
                        worksheet.Cells["C26"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F26"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G26:H26"].Merge = true;
                        worksheet.Cells["G26:H26"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "WORK EXCELLENCE");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            worksheet.Cells["F26"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();// ":";
                            if (Rating == "1")
                            {

                                worksheet.Cells["J26"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J26"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J26:K26"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J26:K26"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J26:L26"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J26:L26"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J26:M26"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J26:M26"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J26:N26"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J26:N26"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G26"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingCore += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B27"].Value = "5";
                        worksheet.Row(27).Height = 30;
                        worksheet.Cells["B27"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C27"].Value = "CONTINOUS LEARNING";
                        worksheet.Cells["C27"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F27"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G27:H27"].Merge = true;
                        worksheet.Cells["G27:H27"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "CONTINOUS LEARNING");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            worksheet.Cells["F27"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            if (Rating == "1")
                            {

                                worksheet.Cells["J27"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J27"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J27:K27"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J27:K27"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J27:L27"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J27:L27"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J27:M27"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J27:M27"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J27:N27"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J27:N27"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G27"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingCore += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B28"].Value = "MANAGERIAL COMPETENCY";
                        worksheet.Cells["B28"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B28:N28"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B28:N28"].Style.Fill.BackgroundColor.SetColor(Color.DarkGray);

                        worksheet.Cells["F28"].Value = "LEVEL";
                        worksheet.Cells["F28"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        
                        worksheet.Cells["B29"].Value = "1";
                        worksheet.Row(29).Height = 30;
                        worksheet.Cells["B29"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C29"].Value = "BUSSINES FINANCIAL ACCUMENT";
                        worksheet.Cells["C29"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F29"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G29:H29"].Merge = true;
                        worksheet.Cells["G29:H29"].Style.WrapText = true;

                        int jumlahRatingManagerial = 0;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "BUSINESS FINANCIAL ACUMEN");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F29"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J29"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J29"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J29:K29"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J29:K29"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J29:L29"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J29:L29"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J29:M29"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J29:M29"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J29:N29"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J29:N29"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G29"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingManagerial = Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B30"].Value = "2";
                        worksheet.Row(30).Height = 30;
                        worksheet.Cells["B30"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C30"].Value = "BUILDING PARTNERSHIP";
                        worksheet.Cells["C30"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F30"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G30:H30"].Merge = true;
                        worksheet.Cells["G30:H30"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "BUILDING BUSINESS PARTNERSHIP");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F30"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J30"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J30"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J30:K30"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J30:K30"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J30:L30"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J30:L30"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J30:M30"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J30:M30"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J30:N30"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J30:N30"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G30"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingManagerial += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B31"].Value = "3";
                        worksheet.Row(31).Height = 30;
                        worksheet.Cells["B31"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C31"].Value = "LEADERSHIP MANAGEMENT";
                        worksheet.Cells["C31"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F31"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G31:H31"].Merge = true;
                        worksheet.Cells["G31:H31"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "LEADERSHIP");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F31"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J31"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J31"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J31:K31"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J31:K31"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J31:L31"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J31:L31"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J31:M31"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J31:M31"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J31:N31"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J31:N31"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G31"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingManagerial += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B32"].Value = "4";
                        worksheet.Row(32).Height = 30;
                        worksheet.Cells["B32"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["C32"].Value = "RESOURCES MANAGEMENT";
                        worksheet.Cells["C32"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        
                        worksheet.Cells["F32"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G32:H32"].Merge = true;
                        worksheet.Cells["G32:H32"].Style.WrapText = true;

                        dtAssesmentDetail = AssesmentPositionDal.GetDataTableReport_Detail(AssesmentPositionID, "RESOURCE MANAGEMENT");
                        if (dtAssesmentDetail.Rows.Count > 0)
                        {
                            worksheet.Cells["F32"].Value = dtAssesmentDetail.Rows[0]["Level"].ToString();//":";
                            Rating = dtAssesmentDetail.Rows[0]["Rating"].ToString();
                            if (Rating == "1")
                            {

                                worksheet.Cells["J32"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J32"].Style.Fill.BackgroundColor.SetColor(Color.DarkRed);
                            }

                            if (Rating == "2")
                            {

                                worksheet.Cells["J32:K32"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J32:K32"].Style.Fill.BackgroundColor.SetColor(Color.Red);
                            }

                            if (Rating == "3")
                            {

                                worksheet.Cells["J32:L32"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J32:L32"].Style.Fill.BackgroundColor.SetColor(Color.Yellow);
                            }

                            if (Rating == "4")
                            {

                                worksheet.Cells["J32:M32"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J32:M32"].Style.Fill.BackgroundColor.SetColor(Color.Green);
                            }

                            if (Rating == "5")
                            {

                                worksheet.Cells["J32:N32"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                                worksheet.Cells["J32:N32"].Style.Fill.BackgroundColor.SetColor(Color.DarkGreen);
                            }

                            worksheet.Cells["G32"].Value = dtAssesmentDetail.Rows[0]["Definition"].ToString();
                            jumlahRatingManagerial += Convert.ToInt32(Rating);
                        }

                        worksheet.Cells["B34"].Value = "ASSESMENT RECOMENDATION";
                        worksheet.Cells["B34:N34"].Merge = true;
                        worksheet.Cells["B34"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B34"].Style.Font.Size = 25;
                        worksheet.Cells["B34"].Style.Font.Color.SetColor(Color.White);
                        worksheet.Cells["B34"].Style.Font.Bold = true;
                        worksheet.Cells["B34:N34"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                        worksheet.Cells["B34:N34"].Style.Fill.BackgroundColor.SetColor(Color.Black);
                        
                        worksheet.Cells["B35"].Value = "TOTAL CORE COMPETENCY";
                        worksheet.Row(35).Height = 30;
                        worksheet.Cells["B35"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["G35:I35"].Merge = true;
                        
                        worksheet.Cells["B35"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B35"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["B35"].Style.Font.Size = 12;
                        
                        worksheet.Cells["G35"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G35"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["G35"].Style.Font.Size = 14;
                        
                        double hasilCore = Convert.ToDouble(jumlahRatingCore) / 5;
                        hasilCore = hasilCore / 5;
                        hasilCore = hasilCore * 100;
                        worksheet.Cells["G35"].Value = hasilCore.ToString() + "%";
                        
                        worksheet.Cells["B35:B38"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B35:N35"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B38:N38"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B35:N38"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B36:N36"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B37:N37"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N35:N38"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["F35:F38"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B3:B32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N3:N32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B21:N21"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B22:N22"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B23:N23"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B24:N24"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B25:N25"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B26:N26"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B27:N27"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B28:N28"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B29:N29"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B30:N30"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B31:N31"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B32:N32"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B23:B27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B29:B32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["F23:F27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["F29:F32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["F23:F27"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["F29:F32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["J23:J27"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["J29:J32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["J23:J27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["J29:J32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["K23:K27"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["K29:K32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["K23:K27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["K29:K32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["L23:L27"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["L29:L32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["L23:L27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["L29:L32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["M23:M27"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["M29:M32"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["M23:M27"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["M29:M32"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        


                        worksheet.Cells["B36"].Value = "TOTAL MANAGERIAL COMPETENCY";
                        worksheet.Row(36).Height = 30;
                        worksheet.Cells["B36"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B36"].Style.Font.Size = 12;
                        worksheet.Cells["B36"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;

                        worksheet.Cells["G36:I36"].Merge = true;
                        worksheet.Cells["G36"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G36"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["G36"].Style.Font.Size = 14;

                        double hasilManagerial = Convert.ToDouble(jumlahRatingManagerial) / 4;
                        hasilManagerial = hasilManagerial / 5;
                        hasilManagerial = hasilManagerial * 100;
                        worksheet.Cells["G36"].Value = hasilManagerial.ToString() + "%";

                        //List<Assesment.Library.DomainObject.Administration.Catalog.TotalFit> listTotalFit = TotalFitDal.GetList();
                        //string FitStart = string.Empty;
                        //string FitEnd = string.Empty;
                        //foreach (Assesment.Library.DomainObject.Administration.Catalog.TotalFit data in listTotalFit)
                        //{
                        //    FitStart = data.FitStart.ToString();
                        //    FitEnd = data.FitEnd.ToString();
                        //}

                        Assesment.Library.DomainObject.Administration.Catalog.TotalFit objTotalFit = TotalFitDal.GetById(TotalFitID);
                        int FitStart = 0;
                        int FitEnd = 0;
                        if (objTotalFit != null)
                        {
                            FitStart = Convert.ToInt32(objTotalFit.FitStart);
                            FitEnd = Convert.ToInt32(objTotalFit.FitEnd);
                            
                        }


                        double FitCore = (hasilCore * FitStart) / 100;
                        double FitManagerial = 0;
                        if(FitEnd>0)
                            FitManagerial = (hasilManagerial * FitEnd) / 100;

                        double HasilFit = FitCore + FitManagerial;

                        worksheet.Cells["B37"].Value = "TOTAL FIT (BOBOT "+FitStart.ToString()+"% : "+FitEnd.ToString()+"%)";
                        worksheet.Row(37).Height = 30;
                        worksheet.Cells["G37:I37"].Merge = true;
                        worksheet.Cells["B37"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B37"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["B37"].Style.Font.Size = 12;

                        worksheet.Cells["G37"].Value = Convert.ToInt32(HasilFit) + "%";
                        worksheet.Cells["G37"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G37"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["G37"].Style.Font.Size = 14;

                        Assesment.Library.DomainObject.Administration.Catalog.Recomendation objRecomendation = RecomendationDal.GetByValue(Convert.ToInt32(HasilFit));
                        
                        worksheet.Cells["B38"].Value = "RECOMENDATION";
                        worksheet.Row(38).Height = 30;
                        worksheet.Cells["G38:I38"].Merge = true;
                        worksheet.Cells["B38"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B38"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["B38"].Style.Font.Size = 12;

                        worksheet.Cells["G38"].Value = objRecomendation == null ? string.Empty : objRecomendation.RecomendationName;
                        worksheet.Cells["G38"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["G38"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
                        worksheet.Cells["G38"].Style.Font.Size = 14;

                        worksheet.Cells["B40"].Value = "PENILAIAN INDIVIDU";
                        worksheet.Cells["B40:N40"].Merge = true;
                        worksheet.Cells["B40"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["B40:N40"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B40:N40"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B40"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N40"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["B41"].Value = PersonalDescription;
                        worksheet.Cells["B41:N41"].Merge = true;
                        worksheet.Cells["B41"].Style.WrapText = true;
                        worksheet.Row(41).Height = 100;
                        worksheet.Cells["B41"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
                        worksheet.Cells["B41"].Style.VerticalAlignment =OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                        
                        worksheet.Cells["B41:N41"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B41"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N41"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;


                        worksheet.Cells["B44:N44"].Merge = true;
                        worksheet.Cells["B44"].Value = "PROFILE KEPRIBADIAN";
                        worksheet.Cells["B44"].Style.Font.Size = 14;
                        worksheet.Cells["B44"].Style.Font.Bold = true;
                        worksheet.Cells["B44:N44"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B44:N44"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B44"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N44"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B44"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["B46"].Value = "1.";
                        worksheet.Cells["B44"].Style.Font.Bold = true;
                        
                        worksheet.Cells["C46:E46"].Merge = true;
                        worksheet.Cells["C46"].Value = "TIPE KEPEMIMPINAN";
                        worksheet.Cells["C46"].Style.Font.Bold = true;

                        worksheet.Cells["F46"].Value = ":";
                        worksheet.Cells["F46"].Style.Font.Bold = true;
                        worksheet.Cells["F46"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["G46:N46"].Merge = true;
                        worksheet.Cells["G46"].Style.Font.Bold = true;
                        worksheet.Cells["G46"].Value = Msdt;

                        worksheet.Cells["B47:N47"].Merge = true;
                        worksheet.Cells["B47"].Value = "HAL YANG DI SUKAI";
                        worksheet.Cells["B47"].Style.Font.Size = 14;
                        worksheet.Cells["B47"].Style.Font.Bold = true;
                        worksheet.Cells["B47:N47"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B47:N47"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B47"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["N47"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B47"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["B49:N49"].Merge = true;
                        worksheet.Cells["B49"].Value = InterpretationPlus;
                        worksheet.Row(49).Height = 100;
                        worksheet.Cells["B49"].Style.WrapText = true;
                        worksheet.Cells["B49"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;

                        worksheet.Cells["B51:N51"].Merge = true;
                        worksheet.Cells["B51"].Value = "HAL YANG TIDAK DI SUKAI";
                        worksheet.Cells["B51"].Style.Font.Size = 14;
                        worksheet.Cells["B51"].Style.Font.Bold = true;
                        worksheet.Cells["B51:N51"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B51:N51"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B51"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B51"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B51"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N51"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        

                        worksheet.Cells["B52:N52"].Merge = true;
                        worksheet.Cells["B52"].Value = InterpretationMin;
                        worksheet.Row(52).Height = 100;
                        worksheet.Cells["B52"].Style.WrapText = true;
                        worksheet.Cells["B52"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
                        
                        // KEPRIBADIAN

                        worksheet.Cells["B54"].Value = "2.";
                        worksheet.Cells["B54"].Style.Font.Bold = true;

                        worksheet.Cells["C54:E54"].Merge = true;
                        worksheet.Cells["C54"].Value = "TIPE KEPRIBADIAN";
                        worksheet.Cells["C54"].Style.Font.Bold = true;

                        worksheet.Cells["F54"].Value = ":";
                        worksheet.Cells["F54"].Style.Font.Bold = true;
                        worksheet.Cells["F54"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["G54:H54"].Merge = true;
                        worksheet.Cells["G54"].Style.Font.Bold = true;
                        worksheet.Cells["G54"].Value = TypePersonality;

                        worksheet.Cells["I54:N54"].Merge = true;
                        worksheet.Cells["I54"].Style.Font.Bold = true;
                        worksheet.Cells["I54"].Value = DiscPersonality;


                        worksheet.Cells["B56:N56"].Merge = true;
                        worksheet.Cells["B56"].Value = Definition;
                        worksheet.Row(56).Height = 200;
                        worksheet.Cells["B56"].Style.WrapText = true;
                        worksheet.Cells["B56"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;

                        worksheet.Cells["B58:N58"].Merge = true;
                        worksheet.Cells["B58"].Value = "HAL YANG DI SUKAI";
                        worksheet.Cells["B58"].Style.Font.Size = 14;
                        worksheet.Cells["B58"].Style.Font.Bold = true;
                        worksheet.Cells["B58:N58"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B58:N58"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B58"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B58"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B58"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N58"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["B60:N60"].Merge = true;
                        worksheet.Cells["B60"].Value = PreferredPlus;
                        worksheet.Row(60).Height = 100;
                        worksheet.Cells["B60"].Style.WrapText = true;
                        worksheet.Cells["B60"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;

                        worksheet.Cells["B61:N61"].Merge = true;
                        worksheet.Cells["B61"].Value = "HAL YANG TIDAK DI SUKAI";
                        worksheet.Cells["B61"].Style.Font.Size = 14;
                        worksheet.Cells["B61"].Style.Font.Bold = true;
                        worksheet.Cells["B61:N61"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B61:N61"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B61"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B61"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B61"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N61"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["B63:N63"].Merge = true;
                        worksheet.Cells["B63"].Value = PreferredMinus;
                        worksheet.Row(63).Height = 100;
                        worksheet.Cells["B63"].Style.WrapText = true;
                        worksheet.Cells["B63"].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;


                        worksheet.Cells["B65:N65"].Merge = true;
                        worksheet.Cells["B65"].Value = "PENGESAHAN";
                        worksheet.Cells["B65"].Style.Font.Size = 14;
                        worksheet.Cells["B65"].Style.Font.Bold = true;
                        worksheet.Cells["B65:N65"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B65:N65"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B65"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B65"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B65"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N65"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["B67:G67"].Merge = true;
                        worksheet.Cells["B67"].Value = "ASSESMENT";
                        //worksheet.Cells["B65"].Style.Font.Size = 14;
                        worksheet.Cells["B67"].Style.Font.Bold = true;
                        worksheet.Cells["B67:G67"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B67:G67"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B67"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B67"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B67"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["H67:N67"].Merge = true;
                        worksheet.Cells["H67"].Value = "JABATAN";
                        //worksheet.Cells["B65"].Style.Font.Size = 14;
                        worksheet.Cells["H67"].Style.Font.Bold = true;
                        worksheet.Cells["H67:N67"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H67:N67"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H67"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H67"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H67"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N67"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;

                        worksheet.Cells["B68:G68"].Merge = true;
                        //worksheet.Cells["B67"].Value = "ASSESMENT";
                        //worksheet.Cells["B65"].Style.Font.Size = 14;
                        worksheet.Cells["B68"].Style.Font.Bold = true;
                        worksheet.Cells["B68:G68"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B68:G68"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B68"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B68"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["B68"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;

                        worksheet.Cells["H68:N68"].Merge = true;
                        //worksheet.Cells["H68"].Value = "JABATAN";
                        //worksheet.Cells["B65"].Style.Font.Size = 14;
                        worksheet.Cells["H68"].Style.Font.Bold = true;
                        worksheet.Cells["H68:N68"].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H68:N68"].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H68"].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H68"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        worksheet.Cells["H68"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                        worksheet.Cells["N68"].Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                        
                        //
                            
                        package.Save();

                        string filename = context.Server.MapPath("~/UploadReport" + @"/"+NIK+"_"+NamaKaryawan+".xlsx");
                        System.IO.FileInfo fileInfo = new System.IO.FileInfo(filename);

                        if (fileInfo.Exists)
                        {
                            context.Response.ContentType = "application/vnd.ms-excel";
                            context.Response.Clear();
                            context.Response.AddHeader("Content-Disposition", "attachment;filename=\"" + fileInfo.Name + "\"");
                            context.Response.AddHeader("Content-Length", fileInfo.Length.ToString());
                            context.Response.ContentType = "application/octet-stream";
                            context.Response.TransmitFile(fileInfo.FullName);
                            context.Response.Flush();

                            //helper.IsSuccess = true;
                            //helper.Message = "sukses";
                        }
                    }
                }
                catch (Exception ex)
                {
                    context.Response.ContentType = "text/plain";
                    context.Response.Write(ex.Message);
                }
                finally
                {
                    context.Response.End();
                }
                
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");
    }


 
    public bool IsReusable {
        get {
            return false;
        }
    }

}